
public class Car {
	
		String model;
		int maxSpeed;
		int currentSpeed;
		String color;
		int currentGear;
		Person  owner;
		boolean haveOwner;
		boolean isSportCar;
		int price;
	
/*Car(String modelParam, boolean isSportCarParam, String colorParam){
			model=modelParam;
			isSportCar= isSportCarParam;
			color=colorParam;}*/
						
// to commit for SVN
Car(boolean isSportCar, String model, String color){
	
		this.isSportCar= isSportCar;
			this.model= model;
			this.color=color;
		
		}
Car(String model, boolean isSportCar, String color, int price, int maxSpeed){
	this(isSportCar, model, color);
	this.price= price;
	
		if(maxSpeed>=200){
			
			if(isSportCar== true){
				this.maxSpeed=maxSpeed;
			}}
		
			else {
				this.maxSpeed=maxSpeed;
			}
		}
@Override
public String toString() {
	return "Car [model=" + model + ", maxSpeed=" + maxSpeed + ", currentSpeed="
			+ currentSpeed + ", color=" + color + ", currentGear="
			+ currentGear + ", owner=" + owner + ", haveOwner=" + haveOwner
			+ ", isSportCar=" + isSportCar + ", price=" + price + "]";
}
		
	boolean isMoreExpensive(Car car){
		
		return(this.price>car.price);
		}
	
	double calculateCarPriceForScrap(double metalPrice){
		double coef=0.2;
		if(this.color.equalsIgnoreCase("white") || this.color.equalsIgnoreCase("black")){
			coef+=0.05;
		}
if(this.isSportCar){
			coef+=0.05;
		}
	return metalPrice*coef;
	}
	
	void changeOwner(Person newOwner){
		this.owner= newOwner;
		
	}
	
	double sellCarForScrap(Person person){
		double priceScrap= this.calculateCarPriceForScrap(1.25);
		person.money+=priceScrap;
		this.price=0;
		return person.money;
	}
		
		

		
	
	
}



		

